#include <bits/stdc++.h>

using namespace std;
string s[205];
int main()
{
	int n = 0;
	int maxlen = 0;
	while ((cin >> s[n]))
	{
		int temp = s[n].length();
		maxlen = max(temp, maxlen);
		n++;
	}
	for (int i = 0; i < maxlen; i++)
	{
		for (int j = 0; j < n; j++)
		{
			if (s[j][i] >= 'A' && s[j][i] <= 'Z')
			{
				cout << s[j][i];
			}
			else if (!(i == maxlen - 1 && j == n - 1))
			{
				cout << " ";
			}
		}
		cout << endl;
	}
	return 0;
}
